package com.guigu.video.controller;


import com.guigu.video.entity.AbComment;
import com.guigu.video.service.AbCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * <p>
 * 评论 前端控制器
 * </p>
 *
 * @author liulinjun
 * @since 2020-07-12
 */
@Controller
@RequestMapping("/abComment")
public class AbCommentController {

    @Autowired
    private AbCommentService AbCommentService;
    @RequestMapping(value = "/add",method = RequestMethod.POST)
    public boolean add(@RequestBody AbComment AbComment){
        return  AbCommentService.save(AbComment);
    }
    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public boolean delete(int id){
        return  AbCommentService.removeById(id);
    }
    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public boolean delete(@RequestBody AbComment AbComment){
        return  AbCommentService.updateById(AbComment);

    }
    @RequestMapping(value = "/select",method = RequestMethod.POST)
    public List<AbComment> add(){
        return  AbCommentService.list();
    }
}

